﻿namespace XYAC.Framework.MonitorTireMaterialOnline.Extensions
{
    public class AppConfig
    {
        /// <summary>
        /// 本地SQL Server连接串。
        /// </summary>
        public string SQLServerConnectionString { get; set; }
        
        /// <summary>
        /// 本地数据报表数据库/数据缓存库
        /// </summary>
        public string LocalReportConnectionStringTemplate { get; set; }
        /// <summary>
        /// Database数据库地址
        /// </summary>
        public string AccessCAreaBaseConnectionString { get; set; }
        /// <summary>
        /// 自定义日志的历史数据库
        /// </summary>
        public string AccessCAreaHisConnectionString { get; set; }
        /// <summary>
        /// Oracle数据库
        /// </summary>
        public String OracleMesConnectionString { get; set; }
        /// <summary>
        /// 本地数据库连接字符串
        /// </summary>
        public string LocalDataConnectionString { get; set; }
        /// <summary>
        /// 是否手动上传
        /// </summary>
        public bool ManualUpload { get; set; }
        /// <summary>
        /// 定期清理的历史数据天数
        /// </summary>
        public int DataCleanerDaysInterval { get; set; }
        /// <summary>
        /// 机台类型0轮毂检测,1离线测厚
        /// </summary>
        public int MachineType { get; set; }
        /// <summary>
        /// 检测机台编号
        /// </summary>
        public String DetectionMachineNo { get; set; }
        /// <summary>
        /// 是否使用自定义计划日期
        /// </summary>
        public bool IsUseCustomizePlanDate { get; set; }
        /// <summary>
        /// 自定义计划时间
        /// </summary>
        public DateTime? CustomizePlanDate { get; set; }

        public AppConfig Clone()
        {
            var json = JsonSerializeHelper.SerializeObjectToJson(this);
            var newConfig = JsonSerializeHelper.DeserializeObjectFromJson<AppConfig>(json);
            return newConfig;
        }

    }
}
